1. Field of the Invention
The present invention generally relates to a method of writing data to a storage device, a related computer program product, and to a storage controller. In particular, the present invention relates to a write cache structure for a storage system including a non-volatile solid state memory device such as a flash memory device.
2. Description of Related Art
Conventional storage systems for enterprise applications typically include arrays of hard disk drives as storage device. A storage controller of the storage system manages operations on the storage device, including organizing and executing read and write operations. Another task of such storage controller refers to caching, i.e. temporarily storing a limited amount of data units frequently being accessed in a combined read and write cache, or in separate read and write caches which caches mostly are embodied as volatile dynamic random access memories (DRAMs). As is widely known, DRAM memory caching technology is characterized by fast access times resulting in high bandwidth on the one hand, and by limited storage capacity compared to the destination storage device on the other hand. Many caching strategies envisage that frequently used data are deposited in a read cache in order to avoid for each read request for such data to access the slower storage device. The main purpose of a write cache is to hide the latency of a slower storage device and to decouple write operations to the storage device from new write or read requests received which write operations can otherwise block or slow down serving the new write or read requests or any other operations. As a result, a write cache allows to temporarily deposit data units therein and to later transfer these data units to the storage device for permanent storage. Further it allows reducing the number of writes to the storage devices if the same data is updated frequently.
Even if the timing of writing data units to the storage device now can be controlled as the data units wait to be destaged from the write cache, still, any write operation from the write cache to the storage device can prevent the storage device from performing other tasks in the meantime. For example, when data units are written from the write cache to a hard disk drive, a write head of the hard disk drive needs to be positioned prior to writing the data to its destination during which time the hard disk drive cannot be used for read. In this sense, it is critical for the overall performance of a storage system to implement a strategy that allows an efficient operation of the write cache.
In “WOW: Wise Order Writes—Combining Spatial and Temporal Locality in Non-Volatile Caches”, by Binny Gill and Dharmendra Modha, FAST 2005, 4th Usenix Conference on File and Storage Technologies, a write cache mechanism is introduced, in which a sorted list of write groups is maintained. The smallest and the highest write groups are joined forming a circular list. A “recency” bit is maintained with each write group. The algorithm now proceeds as follows. A write group is always inserted in its correct sorted position. Upon insertion, its recency bit is set to zero. However, on a write hit, the recency bit is set to one. The destage operation proceeds wherein a destage pointer is maintained that traverses the circular list looking for destage victims. Every write group that is encountered is eventually destaged where only valid data units have to be transferred. However, it is only allowed to destage write groups whose recency bit is zero. The write groups with a recency bit of one are skipped; however, their recency bit is turned off, and reset to zero. The basic idea is to give an extra life to those write groups that have been hit since the last time the destage pointer visited them. This allows to incorporate recency representing temporal locality on one hand, and small average distance between consecutive destages representing spatial locality on the other hand.
In US2003/0140198, a computer system is proposed with a plurality of levels of cache storage, a cache control method prevents data duplication among the levels of cache storage to increase cache storage utilization. A high-level cache staging unit stages reads data from a disk unit, stages the data to a high-level cache, and instructs to destage the data, which has been read, from a low-level cache. A high-level cache destaging unit writes data to be destaged to the disk unit, instructs to stage the data, which has been written, to the low-level cache, and destages the data from the high-level cache. A low-level cache staging unit stages data, which is written by the high-level cache destaging unit, to the low-level cache. A low-level cache destaging unit destages data, which is instructed by the high-level cache staging unit, from the low-level cache.